package com.xintai.system.service.impl;

import com.xintai.system.mapper.GetCodeMapper;
import com.xintai.system.service.IGetCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class GetCodeServiceImpl implements IGetCodeService {

    @Autowired
    private GetCodeMapper getCodeMapper;

    //System.out.println(MyGetCode.myGetCode (1, 100));

    @Override
    public String getCode(Integer StrCode, Integer user_id) throws Exception {

        Map<String,Object> map=new HashMap<String,Object>();
        map.put("StrCode", StrCode);
        map.put("user_id", user_id);
        map.put("ruleCode", "");
        getCodeMapper.getCode(map);

        return map.get("ruleCode").toString();
    }
}
